package com.ssy.lingxi.after.sale.api.model.constant;

import java.util.Arrays;

/**
 * open-api 调用方法类型 类型枚举
 * @author 伍将
 * @date 2021/3/9
 * @version 2.0.0
 */
public enum OpenApiMethodTypeEnum {

    /**
     * 退货-提交审核
     */
    return_submit_verify(11, "退货-提交审核"),
    /**
     * 退货-审核退货申请单(一级)
     */
    return_verify_step_one(12, "审核退货申请单(一级)"),
    /**
     * 退货-审核退货申请单(二级)
     */
    return_verify_step_two(13, "审核退货申请单(二级)"),
    /**
     * 退货-确认申请单
     */
    return_confirm_verify(14, "确认申请单");

    private final Integer code;
    private final String message;

    OpenApiMethodTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        OpenApiMethodTypeEnum item = Arrays.stream(OpenApiMethodTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return null != item ? item.getMessage() : "";
    }
}
